﻿using SmartAgricultureService.Models.Enums;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace SmartAgricultureService.Tables
{
    [Table("Device")]
    public class DeviceEntry
    {
        [Key]
        [MaxLength(50)]
        public string Id { get; set; }
        [MaxLength(100)]
        public string Name { get; set; }
        [Required]
        [MaxLength(50)]
        public string AreaId { get; set; }
        [Required]
        [MaxLength(50)]
        public string CropId { get; set; }
        [Required]
        [MaxLength(50)]
        public string Mac { get; set; }
        [MaxLength(4096)]
        public string Token { get; set; }
        public DeviceType Type { get; set; }
        public bool Active { get; set; }
        public bool Delete { get; set; }
        public virtual AreaEntry Area { get; set; }
        public virtual CropEntry Crop { get; set; }
        public virtual ICollection<LogEntry> LogEntries { get; set; }
        public virtual ICollection<UploadEntry> UploadEntries { get; set; }
        public virtual ICollection<ReportDetailEntry> ReportDetails { get; set; }
    }
}